const checkName = (name='') => {
  if(name.length<2||name.length>20) {
    return false
  }
  return true
}

//校验密码：只能输入6-20个字母、数字、下划线  
const checkPassword = pwd => {
 if(!(/^(\w){6,20}$/.exec(pwd))) return false
 return true
}

const checkMobile = mobile => {
  if(!(/^1[3|4|5|7|8][0-9]{9}$/.exec(mobile))) return false
  return true
  
}
const checkEmail = email => {
  if(!(/^(\w-*\.*)+@(\w-?)+(\.\w{2,})+$/.exec(email))) return false
  return true
}
export {
  checkEmail,
  checkMobile,
  checkName,
  checkPassword
}

